added Feb 2001 SDK
[windows-sources.git] / shared source / wpf / src / host / shimimpl / shimutilities.hxx
blob4eb9304f6e1c79f4b6759142b6d110afd67d536f
1 //+-----------------------------------------------------------------------
2 //
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 //
5 // Description:
6 // Defines the utility functions of PresentationHost.
7 //
8 // History
9 // 2002/06/19-murrayw
10 // Created
11 // 2003/06/30-[....]
12 // Ported ByteRangeDownloader to WCP
13 // 2007/09/20-[....]
14 // Ported Windows->DevDiv. See SourcesHistory.txt.
16 //------------------------------------------------------------------------
18 #pragma once
20 //******************************************************************************
22 // Defines
24 //******************************************************************************
26 #define EMBEDDINGFLAG L"Embedding"
27 #define DEBUGFLAG L"Debug"
28 #define EVENTFLAG L"Event"
29 #define DEBUGSECURITYZONEURLFLAG L"DebugSecurityZoneURL"
30 #define LAUNCHDOTAPPLICATIONFLAG L"LaunchApplication"
31 #define REGISTERSERVERFLAG L"RegServer"
32 #define UNREGISTERSERVERFLAG L"UnregServer"
34 #define URL_SCHEME_SECURE L"https"
36 // Individual flags
37 #define FLAG_EMBEDDING 0x01
38 #define FLAG_DEBUG 0x02
39 #define FLAG_EVENT 0x04
40 #define FLAG_DEBUGSECURITYZONEURL 0x08
41 #define FLAG_LAUNCHDOTAPPLICATION 0x10
42 #define FLAG_REGISTERSERVER 0x20
43 #define FLAG_UNREGISTERSERVER 0x40
45 // Combinations of flags
46 #define FLAGS_NONE 0x00
48 #define PATH_BUFFER_SIZE (MAX_PATH + 64)
49 #define DEBUGSECURITYZONEURL_BUFFER_SIZE (MAX_PATH + 64)
51 #ifdef APPLICATION_SHIM
52 // DFSHIM stuff for launching click once .application
53 #define DFDLL L"dfdll.dll"
54 #define URLACTION_MANAGED_UNSIGNED 0x00002004
55 #define URLACTION_MANAGED_SIGNED 0x00002001
56 typedef HRESULT (*fnActivateDeploymentEx)(__in LPCWSTR deploymentUrl, DWORD dwUnsignedPolicy, DWORD dwSignedPolicy);
57 #endif
59 //******************************************************************************
61 // Prototypes
63 //******************************************************************************
65 HRESULT ParseCommandLine(__out_ecount(1) LPDWORD pdwFlags,
66 __out_ecount(nFileNameSize) LPWSTR pwzFileName,
67 size_t nFileNameSize,
68 __out_ecount(nEventNameSize) LPWSTR pwzEventName,
69 size_t nEventNameSize,
70 __out_ecount(nDebugSecurityZoneURLSize) LPWSTR pwzDebugSecurityZoneURL,
71 size_t nDebugSecurityZoneURLSize,
72 __out_ecount_opt(nDotApplicationURLSize) LPWSTR pwzDotApplicationURL,
73 size_t nDotApplicationURLSize);
75 BOOL MsgWaitForSingleObject(__in HANDLE hEvent, DWORD dwMilliSeconds, __out_ecount(1) BOOL* fWmQuit);
77 MimeType GetMimeTypeFromString(LPCWSTR szMimeString);
79 BOOL IsValidMimeType(__in MimeType mime);
81 // Returned message buffer must be freed with LocalFree().
82 wchar_t *TryDecodeDownloadError(HRESULT hr);
84 // Defined in dll\Utilities.cxx
85 size_t LoadResourceString(int id, __out_ecount(cchBufSize) wchar_t *pBuf, size_t cchBufSize);
86 BSTR LoadResourceString(int id);
88 #ifdef DOCUMENT_SHIM
89 HRESULT EndsWith(LPCWSTR szTarget, LPCWSTR szMatch);
90 #endif
93 //*********************************************************************************
94 // Click Once Helpers
95 //*********************************************************************************
96 #ifdef APPLICATION_SHIM
97 HRESULT LaunchClickOnceApplication(LPCWSTR szApplicationURL);
98 #endif